{% include 'QLGL/QLGL_index.html' %}

<div class="am-cf admin-main">
  {% include 'sidebar.html' %}
  <!-- content start -->
  <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">巡检业务</strong></div>
      </div>
      <div class="am-g" style="position: absolute;height: 100%;right: 0px;left: 260px;width: auto;">

        {% include 'QLGL/XJYW/QLGL_XJYW_SIDEBAR.html' %}
        
        
        <div class="am-u-sm-10" style="position: absolute;width:auto;right:0;left: 200px;">
          <!-- <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">天气情况</strong></div> -->
            <div class="am-g am-margin-top am-form-group">
              <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">天气情况</strong></div>
            </div>
            <div class="am-g am-margin-top am-form-group">
              <div class="am-u-sm-4 am-u-md-3 am-text-right">天气:</div>
              <div class="am-u-sm-8 am-u-md-9" style="padding-left: 0rem;">
                  <select data-am-selected="{btnSize: 'sm'}" id='tq_weather'>
                    <option value="晴">晴</option>
                    <option value="多云">多云</option>
                    <option value="小雨">小雨</option>
                    <option value="大雨">大雨</option>
                    <option value="下雪">下雪</option>
                    <option value="大风">大风</option>
                  </select>
              </div>
            </div>
            <div class="am-g am-margin-top am-form-group">
              <div class="am-u-sm-4 am-u-md-3 am-text-right">温度:</div>
              <div class="am-u-sm-8 am-u-md-9" style="padding-left: 0rem;">
                  <input type="text" value=21 onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onblur="this.v();" class="am-input-lg" id='tq_temperature' min='-66' max='66'>℃
              </div>
            </div>
            <div class="am-g">
              <div>
                <div class="am-btn-toolbar">
                    <button style="margin: 10px 25%;" type="button" id='btn_tqsave' class="am-btn am-btn-default"><span class="am-icon-save"></span><a href="#">保存</a></button>
                </div>
              </div>
            </div>






          

        </div>
      </div>
    </div>
  </div>
</div>
{% include 'footer.html' %}
<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="/static/assets/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="/static/assets/js/amazeui.min.js"></script>
<script src="/static/assets/js/amazeui.tree.js"></script>
<script type="text/javascript" src="/static/assets/js/layer.js"></script>
<script src="/static/assets/datatables/amazeui.datatables.min.js"></script>
<script src="/static/assets/dialog/amazeui.dialog.min.js"></script>
<link rel="stylesheet" type="text/css" href="/static/assets/css/amazeui.tree.css" />
<script src="/static/assets/js/app.js"></script>
<style type="text/css">
  .li_a {
    color: #5c5c5c;
  }
</style>
<script type="text/javascript">
  $("#collapse-nav1").addClass("am-in");
  $("#qlgl").removeClass("am-collapsed");
  $("#qlglOxjyw").css("color", "#3399CC");
  $("#qlgl").css("color", "#3399CC");
  $("#xjywOrcxc").removeClass("li_a");


 $(window).load(function () {
     $('#btn_tqsave').on('click',saveTQ);
 });
  var saveTQ = function(){
    var weather = $('#tq_weather').val();
    var temperature = $('#tq_temperature').val()*1;
    //数据校验
    if(temperature<-66 || temperature>66)
    {
        AlertMSG("温度范围只能在-66~66之间")
        return;
    }

    localStorage.removeItem("weather");
    localStorage.removeItem("temperature");
    $.ajax({
          "url":'/weatherSave_WH/?tid={{ taskid }}&w='+weather+'&t='+temperature,
          "datatype":"json",
          "type":"get",
          "success":function(result){
            if (result.status == 1)
            {
                //alert(result.message);
                // 存储天气温度数据
                localStorage.weather=weather;
                localStorage.temperature=temperature;
                //跳转页面
                window.location='/JCJL/?tid={{ taskid }}&w='+weather+'&t='+temperature;

            }else{
                console.log('error')
            }
        },
          "error":function(err,result){
            if(err.length!=0)
            {
                console.log(result);
                return;
            }
          }
      });
}

  var AlertMSG=function(msg){
    AMUI.dialog.alert({ title: '错误提示', content: msg, onConfirm: function() { console.log('close'); } });
  }







</script>
 
</body>

</html>